from pyspark.context import SparkContext
from pyspark.sql import SparkSession
sc = SparkContext(appName="Feature_Unins")
spark = SparkSession \
    .builder \
    .appName("Feature_Unins") \
    .enableHiveSupport() \
    .getOrCreate()
sc.setLogLevel('ERROR')

import sys
db = 'liz'
spark.sql("use {db}".format(db=db))
in_tb = sys.argv[1]
# in_tb = 'fly_tmp_blk1'
dataframe = spark.read.parquet("hdfs://getui-bi-ds/user/hive/warehouse/liz.db/{in_tb}".format(in_tb=in_tb))
dataframe.show()
# dataframe.write.saveAsTable(in_tb, None, "overwrite", None)

